<%--
  Created by IntelliJ IDEA.
  User: 王鹏飞
  Date: 2020/7/20
  Time: 9:53
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<jsp:include page="../common/menu.jsp" />
<html>
<head>
    <title>车辆添加</title>
</head>
<body class="form-wrap">

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header">添加驾驶员</div>
        <div class="layui-card-body" style="padding: 15px;">
            <form class="layui-form" action="<%=basePath %>pilot/addPilot" name="warehouseAreaForm" method="post" lay-filter="component-form-group">
                <div class="layui-form-item">
                    <label class="layui-form-label">驾驶员姓名</label>
                    <div class="layui-input-block">
                        <input type="text" name="pilotName" value="" autocomplete="off"  class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">身份证号码</label>
                    <div class="layui-input-block">
                        <input type="text" name="pilotCrad" id="pilotCrad" autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">联系电话</label>
                    <div class="layui-input-block">
                        <input type="number" name="pilotTel" id="pilotTel" autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">联系地址</label>
                    <div class="layui-input-block">
                        <input type="text" value="" name="pilotAdr" id='pilotAdr' autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">驾驶证有效期</label>
                    <div class="layui-input-block">
                        <input type="text" value="" name="pilotLicenseTime" id='pilotLicenseTime' class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">上岗有效期</label>
                    <div class="layui-input-block">
                        <input type="text" value="" name="workLicenseTime" id='workLicenseTime' class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">是否可用</label>
                    <div class="layui-input-block">
                        <input type="checkbox" name="status" value="1" checked="" lay-skin="switch" lay-text="允许|禁止"><div class="layui-unselect layui-form-switch layui-form-onswitch" lay-skin="_switch"><em>允许</em><i></i></div>
                </div>
        </div>

        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea name="remark" class="layui-textarea"></textarea>
            </div>
        </div>

        <div class="layui-form-item layui-layout-admin">
            <div class="layui-input-block">
                <div class="layui-footer" style="text-align: center;">
                    <button class="layui-btn" lay-submit="" lay-filter="component-form-demo1">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    <button class="layui-btn layui-btn-primary" id="back">返回</button>
                </div>
            </div>
        </div>
        </form>
    </div>
</div>
</div>
</body>

<script type="text/javascript">

    $('document').ready(function(){

        layui.use(['form','laydate'], function(){
            var form = layui.form;
            var laydate = layui.laydate;

            laydate.render({
               elem : '#pilotLicenseTime',
               trigger : 'click'
            });
            laydate.render({
                elem : '#workLicenseTime',
                trigger : 'click'
            });

            /* 监听提交 */
            form.on('submit(component-form-demo1)', function(data){
                var form = document.forms[0];
                form.submit();
                return false;
            });
        });

        $('#back').click(function(){
            window.location.href="<%=basePath %>pilot/toPilotList";
            return false;
        });

    });
</script>
</html>
<jsp:include page="../common/js.jsp" />